package com.rd.student.jiaji.class3.xumingze.exam;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Scanner;

public class Test02 {
    String name;
    String team;

    public static void main(String[] args) throws IOException {
        File file = new File("player.txt");
        file.createNewFile();

        HashMap hashMap = new HashMap();
        hashMap.put("杜兰特", "勇士队");
        hashMap.put("威少", "雷霆队");
        hashMap.put("库里", "勇士队");
        hashMap.put("石破天", "湖人队");
        hashMap.put("科比", "湖人队");

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入要查询的球员:");
        String player = scanner.nextLine();
        if (hashMap.get(player) != null) {
            System.out.println(player + "所属于" + hashMap.get(player));
        }else {
            System.out.println("不存在该球员");
        }
    }
}
